package com.buwstudio.api;

import java.security.Principal;

import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
public class UserController {

	/**
	 * 
	 * Description:
	 * 试试看，
	 * 应该与ResourceController的public Object getPrincipal()的返回值一样吧
	 * @author 卜 伟<br>
	 * Last Modified: <br>
	 * 2017年5月27日 下午3:07:30
	 */
	@RequestMapping("/user")
	public Principal user(Principal user,
			@RequestHeader(value="Authorization") String authorization) {
		log.info("token: "+authorization);
		return user;
	}
}
